package com.timber.util;

import java.util.Vector;

import com.timber.tableModels.InvColumnManager;

public class PaymentTableModel extends SLTableModel  {
	
	
	protected static Vector			v = new Vector();
	protected static ColumnSortDescriptor[]	defaultSortCols;
	private static final long serialVersionUID = 1L;
	
	static
	{
		cm = new InvColumnManager();
		v.add( cm.getByIdClone( InvColumnManager.CUSTOMERNAME ) );
		v.add( cm.getByIdClone( InvColumnManager.PAYMENTDATE  ) );
		v.add( cm.getByIdClone( InvColumnManager.PAYMENTAMOUNT  ) );
		
	}
	
	
	
	public Object getFieldAt(Object obj, int c) {
		
		Object ret = null;
		
		if( obj != null )
		{
			int id = getColumnId( c );	
			PaymentBean item = (PaymentBean)obj;
			switch(id)
			{
			
			case InvColumnManager.CUSTOMERNAME:
				ret =item.getCustomerName();			
			break;
			case InvColumnManager.PAYMENTAMOUNT:
				ret =new Double(item.getPaymentAmount());			
			break;
			
			case InvColumnManager.PAYMENTDATE:
				ret =item.getPaymentDate();			
			break;
			
			}
			
		}
		
		return ret;
	}
	
	public PaymentTableModel()
	{
		super( 0, v );
		// setDefaultSortCols( defaultSortCols );
		//setAlterBgOnSort();
	}
	
	public PaymentTableModel( Vector dataVector )
	{
		super( dataVector, v );
		// setDefaultSortCols( defaultSortCols );
		// setAlterBgOnSort();
	}
	
	
}
